<template>
  <div id="app">
    <transition name="router-fade" mode="out-in">
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive"></router-view>
      </keep-alive>
    </transition>
    <transition name="router-fade" mode="out-in">
      <router-view v-if="!$route.meta.keepAlive"></router-view>
    </transition>
  </div>
</template>

<script>
export default {
  // Vue 2 选项式 API
  name: 'App',

  // 不需要 setup()，直接通过 this.$route 访问路由
  computed: {
    // 如果需要在模板中使用简写 route 变量，可以通过计算属性实现
    route() {
      return this.$route;
    },
  },
};
</script>

<style lang="scss">
  @import './style/common';
  @import "./style/iconfont";

  body {
    margin: 0;
    padding: 0;
  }
</style>
